<include file="Order:leftmenu" />
<link rel="stylesheet" href="__STATIC__admin/css/order.css">
<script src="__STATIC__admin/js/laydate/laydate.js"></script>
<object id="CaiNiaoPrint_OB" classid="clsid:09896DB8-1189-44B5-BADC-D6DB5286AC57" width=0 height=0> 
	<embed id="CaiNiaoPrint_EM" TYPE="application/x-cainiaoprint" width=0 height=0  ></embed>
</object> 

<object id="CaiNiaoPrint_OB_2" classid="clsid:09896DB8-1189-44B5-BADC-D6DB5286AC57" width=0 height=0> 
  <param name="Caption" value="内嵌显示区域">
  <param name="Border" value="1">
  <param name="Color" value="#C0C0C0">
  <embed id="CaiNiaoPrint_EM_2" TYPE="application/x-cainiaoprint" width=0 height=0>
</object> 

<div class="content-right fl">
	<h1 class="content-right-title">
		订单列表
	</h1>
	<form action="" method="get" id="searchForm">
		<div class="tables-searchbox">
			<input type="text" class="input mini" placeholder="商品名称" name="goods_name" id="goods_name" value="<?php echo get('goods_name');?>">
			<input type="text" placeholder="输入订单号" class="input mini" name="order_sn" id="order_sn" value="<?php echo get('order_sn');?>">
			<input type="text" placeholder="输入收货人" class="input mini" name="delivery_name" id="delivery_name" value="<?php echo get('delivery_name');?>">
			<input type="text" placeholder="输入手机号" class="input mini" name="delivery_mobile" id="delivery_mobile" value="<?php echo get('delivery_mobile');?>">
			
		</div>
		<div class="tables-searchbox">
			<input type="text" class="input mini" placeholder="下单人ID" name="order_user_id" id="order_user_id" value="<?php echo get('order_user_id');?>">
			<input type="text" class="input mini" placeholder="销售人ID" name="xiaoshou_user_id" id="xiaoshou_user_id" value="<?php echo get('xiaoshou_user_id');?>">
			<input type="text" class="input mini" placeholder="皇冠ID" name="king_uid" id="king_uid" value="<?php echo get('king_uid');?>">
			<input type="text" class="input mini" placeholder="皇冠姓名" name="king_realname" id="king_realname" value="<?php echo get('king_realname');?>">
			<input type="text" name="start_create_time" id="start_create_time" value="<?php echo get('start_create_time');?>" placeholder="订单创建起始时间" class="input  newinput">
			<span class="mgr5">至</span> 
			<input type="text" name="end_create_time" id="end_create_time" value="<?php echo get('end_create_time');?>" placeholder="订单创建结束时间" class="input  newinput" > 
	
		</div>
		<div>
		
			<select name="express" class="select mini" id="express">
				<option value="" <?php echo (get("express") == "") ? "selected" : "";?> >配送方式</option>
				
	<?php foreach($expresscom as $k=>$v){ ?>
	
		<option value="<?php echo $v['ecom_name'];?>" <?php echo (get("express") == $v['ecom_name']) ? "selected" : "";?> ><?php echo $v['ecom_name'];?></option>
	
	<?php } ?>
				
				
				
				
			</select>
			<input type="hidden"  name="status" value="7">
			<input type="text" placeholder="输入快递单号" class="input mini" name="express_no" id="express_no" value="<?php echo get('express_no');?>"> 
			<button class="btn btn-primary vtal-2">
				<i class="gicon-search white"></i>查询
			</button>
			<a href="/admin/order/kingorder/status/7" class="btn btn-primary vtal-2">清除查询</a>
			<a class="btn btn-success " href="javascript:excel();"><i class="gicon-share white"></i>导出</a>
			
		</div>
	</form>
	

	<!-- 3.待退款 4已退款,5发货,2完成,0未完成,6订单关闭,1已付款 -->
	<div class="tabs clearfix mgt15 tabs-width order-numbers">
		<a href="/admin/order/kingorder/status/7<?php echo $params;?>" class="<?php echo ($status == 7 && !get('printed'))?'active':'';?> tabs_a fl">全部订单(<?php echo $count[7];?>)</a>
		<a href="/admin/order/kingorder/status/1<?php echo $params;?>" class="<?php echo ($status == 1)?'active':'';?> tabs_a fl order1">待发货(<?php echo $count[1];?>)</a>
		<a href="/admin/order/kingorder/status/0<?php echo $params;?>" class="<?php echo ($status == 0 && $action!='express')?'active':'';?> tabs_a fl order0">待付款(<?php echo $count[0];?>)</a> 
		<a href="/admin/order/kingorder/status/5<?php echo $params;?>" class="<?php echo ($status == 5)?'active':'';?> tabs_a fl order2">已发货(<?php echo $count[5];?>)</a>
		<a href="/admin/order/kingorder/status/2<?php echo $params;?>" class="<?php echo ($status == 2)?'active':'';?> tabs_a fl order3">交易完成(<?php echo $count[2];?>)</a>
		<a href="/admin/order/kingorder/status/6<?php echo $params;?>" class="<?php echo ($status == 6)?'active':'';?> tabs_a fl order4">已关闭(<?php echo $count[6];?>)</a>
		<a href="/admin/order/kingorder/status/3<?php echo $params;?>" class="<?php echo ($status == 3)?'active':'';?> tabs_a fl order3">待退款(<?php echo $count[3];?>)</a>
		<a href="/admin/order/kingorder/status/4<?php echo $params;?>" class="<?php echo ($status == 4)?'active':'';?> tabs_a fl order4">退款完成(<?php echo $count[4];?>)</a>
<!--  
		<a href="/admin/order/kingorder/printed/1<?php echo $params;?>" class="<?php echo (get('printed') == 1)?'active':'';?> tabs_a fl order3">已打印面单(<?php echo $count[9];?>)</a>
		<a href="/admin/order/kingorder/printed/2<?php echo $params;?>" class="<?php echo (get('printed') == 2)?'active':'';?> tabs_a fl order4">未打印面单(<?php echo $count[10];?>)</a>
-->
	</div>
	<!-- end tabs -->

<style>
.goods td{
	border:0px;border-bottom:1px solid #e7e7eb;	
}

.goods tr{
	height:75px;
}

.goods td:last-child{
	border-left:0px;
	border-right:0px;
}

.goods td:first-child{
	border-left:0px;
	border-right:0px;
}

.maingoods{
	min-height:113px;
}

.bigfont{
	font-size:16px;
	font-weight:bold;
}

.red{
	color:#ff0000;
}

.green{
	color:#25c401;
}

.gray{
	color:#999;
}

.yellow{
	color: #db7e05;
}

</style>


	<?php foreach($datalist as $key=>$value){?>

	<table width="100%" class="wxtables table-order mgt10">

		<colgroup>
			<col width="35%">
			<col width="9%">
			<col width="11%">
			<col width="11%">
			<col width="8%">
			<col width="10%">
			
		</colgroup>

		<thead>
			<tr>
				<td colspan="8" style="background-color:#eee;text-align:left;" >编号:<?php echo $value['order_id']; ?> 
				订单号:<?php echo $value['order_sn']; ?> 下单:<?php echo $value['create_time']; ?> 
				<?php if($value['pay_time']){?>付款:<?php echo $value['pay_time']; ?><?php } ?> 
				<?php if($value['send_time']){?>发货:<?php echo $value['send_time']; ?><?php } ?> 
				<?php if($value['shouhuo_time']){?>收货:<?php echo $value['shouhuo_time']; ?><?php } ?>
				<?php if($value['close_time']){?>关闭时间:<?php echo $value['close_time']; ?><?php echo $value['is_closebysys'] ? "(超时关闭)":"(用户关闭)";?><?php } ?>
				<?php if($value['refer_uid']){?>推荐人: <?php echo emoji_unified_to_html($value['refer_nickname']); ?> 推荐人ID:<?php echo $value['refer_uid']; ?><?php } ?>
				<?php if($value['king_uid']){?>皇冠: <?php echo emoji_unified_to_html($value['king_realname']); ?> 皇冠ID:<?php echo $value['king_uid']; ?><?php } ?>
				</td>
			</tr>
		</thead>
		
		<tr bgcolor="#FFFFFF" class="maingoods">
		
			<td width="35%" style="padding:0px;" >
			<table width="100%" cellpadding="0" cellspacing="0" class="goods">
			
					<?php if($value['goods']){ foreach($value['goods'] as $kk=>$val){ ?>
					<tr>
						<td width="15%" align="center"><img src="<?php echo C('UPYUN_DOMAIN').$val['goods_pic']; ?>!headimgurl" onerror="javascript:this.src='__STATIC__admin/images/error.png';" width="60" height="60"></td>
						<td width="35%" align="left"><?php echo $val['goods_name'] ?> <?php echo $val['guige_name'] ? '【'.$val['guige_name'].'】' : '';?></td>
						<td width="15%" align="center">单价<br /><?php echo $val['shop_price']; ?></td>
						<td width="20%" align="center">数量<br /><?php echo $val['num']; ?></td>
						<td width="15%" align="center">小计<br /><?php echo number_format($val['shop_price']*$val['num'], 2, '.', ''); ?></td>
					</tr>

					<?php   } }else{    ?>
								<tr>
									<td width="15%" align="center"><img src="<?php echo C('UPYUN_DOMAIN').$val['goods_pic']; ?>!headimgurl" onerror="javascript:this.src='__STATIC__admin/images/error.png';" width="60" height="60"></td>
									<td width="35%" align="left"><?=$value['order_title']?></td>
									<td width="15%" align="center">单价<br /><?php echo $value['all_money']; ?></td>
									<td width="20%" align="center">数量<br />1</td>
									<td width="15%" align="center">小计<br /><?php echo $value['all_money']; ?></td>
								</tr>


									<?php    } ?>
			</table>
			</td>
			


<td>

<?php if($value['pay_money']>0){ ?>
微信支付: <span class="green">&yen;<?php echo $value['pay_money']; ?></span><br>
<?php } ?>

<?php if($value['yongjin_money']>0){ ?>
<?php echo C("YONGJIN_NAME");?>支付: <span class="green">&yen;<?php echo $value['yongjin_money']; ?></span><br>
<?php } ?>

<?php if($value['score_money']>0){ ?>
<?php echo C("SCORE_NAME");?>支付: <span class="green">&yen;<?php echo $value['score_money']; ?></span><br>
<?php } ?>


<?php if($value['cash_money']>0){ ?>
<?php echo C("CASH_NAME");?>支付: <span class="green">&yen;<?php echo $value['cash_money']; ?></span><br>
<?php } ?>


<?php if($value['tihuo_money']>0){ ?>
<?php echo C("TIHUO_NAME");?>支付: <span class="green">&yen;<?php echo $value['tihuo_money']; ?></span><br>
<?php } ?>
</td>

			<td>
			商品:+&yen;<?php echo $value['pay_orgmoney']; ?>
			<br>运费: +&yen;<?php echo $value['shipping']; ?>
			<br>折扣: -&yen;<?php echo $value['zhekou_money']; ?>

			
			</td>
			
			<td>
			
<?php echo emoji_unified_to_html($value['nickname']); ?>

(<a style="color:blue;" href="/admin/order/kingorder/status/7?order_user_id=<?php echo $value['uid']; ?>">编号: <?php echo $value['uid']; ?></a>)




			</td>
			
			<td>
			<span class="bigfont"><?php echo $value['ostatus3'];?></span>
			</td>
			
			<td>
				<span class="red bigfont"><?php echo price_format($value['pay_orgmoney']+$value['shipping']); ?></span>
			</td>
		
			
			
			
			
		</tr>



		<tr>
			<td colspan="9" style="text-align:left;">收货信息: 收货人：<?php echo $value['delivery_name']?$value['delivery_name']:$value['realname'];?> <?php if($value['delivery']['province']!=''){ ?>收货地址：<?php echo $value['delivery']['province']." ".$value['delivery']['city']." ".$value['delivery']['county']." ".$value['delivery']['address'];?><?php } ?> &nbsp;&nbsp;&nbsp;&nbsp;联系电话：<?php echo $value['delivery']['delivery_mobile']?$value['delivery']['delivery_mobile']:$value['delivery_mobile'];?> <?php if($value['delivery']['wechat_user']!=''){ ?>微信号:<?php echo $value['delivery']['wechat_user'];?><?php } ?></td>
		</tr>
		
		<?php if($value['khnote']!=''){ ?>
		<tr>
			<td colspan="9" style="text-align:left;">客户留言: <?php echo $value['khnote']; ?></td>
		</tr>
		<?php } ?>

	</table>
	<?php } ?>


	<div class="tables-btmctrl clearfix">
           <div class="mgt10">
               <div class="paginate">
                  {$page}
               </div>
           </div>
	</div>


</div>
